package com.twu.biblioteca.menu;

import com.twu.biblioteca.Library;
import com.twu.biblioteca.Movie;
import com.twu.biblioteca.menuitem.MenuItem;
import com.twu.biblioteca.menuitem.MovieListMenuItem;

import java.io.PrintWriter;

/**
 * Created with IntelliJ IDEA.
 * User: twer
 * Date: 5/24/13
 * Time: 10:33 PM
 * To change this template use File | Settings | File Templates.
 */
public class MovieListMenu extends Menu {

    private final Library lib;
    private final PrintWriter printWriter;

    public MovieListMenu(Library lib, PrintWriter printWriter) {
        super(printWriter);
        this.lib = lib;
        this.printWriter = printWriter;
        for(Movie movie : lib.getMovies()){
            addMenuItem(new MovieListMenuItem(movie));
        }
    }

    public void show(){
        printWriter.println("Movie\tYear\tDirector\tRating");
        super.show();
    }
}
